package com.fdd.op.sdk.request.api.verify.company;

import com.fdd.op.sdk.ApiRuleException;
import com.fdd.op.sdk.BaseFddRequest;
import com.fdd.op.sdk.constants.Constants;
import com.fdd.op.sdk.internal.mapping.RequestField;
import com.fdd.op.sdk.internal.util.StringUtils;
import com.fdd.op.sdk.response.api.verify.company.ResultResponse;

import java.util.Map;

public class ResultRequest extends BaseFddRequest<ResultResponse> {
    @Override
    public String getApiMethodName() {
        return "/user/api/verify/company/result";
    }

    @Override
    public Map<String, Object> getTextParams() {
        return null;
    }

    @Override
    public Class<ResultResponse> getResponseClass() {
        return ResultResponse.class;
    }

    @Override
    public void check() throws ApiRuleException {
        if(StringUtils.isBlank(getCompanyId()) && StringUtils.isBlank(getTpOrgId())){
            throw new ApiRuleException("22008", "企业在电子签系统的companyId与在客户业务系统的tpOrgId只能二选一");
        }
    }

    @Override
    public String getHttpMethod() {
        return Constants.METHOD_GET;
    }

    @RequestField
    private String companyId;

    @RequestField
    private String tpOrgId;

    public String getCompanyId() {
        return companyId;
    }

    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }

    public String getTpOrgId() {
        return tpOrgId;
    }

    public void setTpOrgId(String tpOrgId) {
        this.tpOrgId = tpOrgId;
    }
}
